{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="javascript:;">标签列表</a></li>
</ul>
<div class="app-content">
    <!--顶部操作-->
    <div class="app-filter">
        <div class="filter-action">
            <a href="{php echo web_url('recruit/recruitment/labelEdit')}" class="btn btn-primary">添加标签</a>
            <a href="javascript:;" class="btn btn-info" id="createButton" title="一键生成默认标签信息">一键生成</a>
        </div>
        <div class="filter-list">
            <form action="" method="get" class="form-horizontal" role="form" id="form1">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{MODULE_NAME}" />
                <input type="hidden" name="p" value="recruit" />
                <input type="hidden" name="ac" value="recruitment" />
                <input type="hidden" name="do" value="labelList" />
                <div class="form-group">
                    <div class="col-sm-2 control-label">标签名称</div>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="title" value="{$title}" placeholder="请输入标签名称...">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">标签类型</label>
                    <div class="col-sm-9">
                        <select name="type" class="form-control">
                            <option value="0">全部</option>
                            <option value="1" {if $type == 1}selected="selected"{/if}>学历要求</option>
                            <option value="2" {if $type == 2}selected="selected"{/if}>职位福利</option>
                            <option value="3" {if $type == 3}selected="selected"{/if}>经验标签</option>
                            <option value="4" {if $type == 4}selected="selected"{/if}>企业规模</option>
                            <option value="5" {if $type == 5}selected="selected"{/if}>企业性质</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label"></div>
                    <div class="col-sm-9">
                        <button class="btn btn-primary" type="submit">搜索</button>
                        <a href="{php echo web_url('recruit/recruitment/labelList')}" class="btn btn-danger">清除</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--表格信息-->
    <div class="app-table-list">
        <!--列表信息-->
        <div class="table-responsive order-list">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th class="text-center"><input type="checkbox" /></th>
                        <th class="text-center">标签标题</th>
                        <th class="text-center">标签类型</th>
                        <th class="text-center">排序</th>
                        <th class="text-center">创建时间</th>
                        <th class="text-center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {loop $list $key $item}
                        <tr class="text-center">
                            <td><input type="checkbox" value="{$item['id']}" /></td>
                            <td>{$item['title']}</td>
                            <td>
                                {if $item['type'] == '1'}
                                    <label class="label label-primary">学历要求</label>
                                {elseif $item['type'] == '2'}
                                    <label class="label label-danger">职位福利</label>
                                {elseif $item['type'] == '3'}
                                    <label class="label label-success">经验标签</label>
                                {elseif $item['type'] == '4'}
                                    <label class="label label-inverse">企业规模</label>
                                {elseif $item['type'] == '5'}
                                    <label class="label label-default">企业性质</label>
                                {/if}
                            </td>
                            <td>{$item['sort']}</td>
                            <td>{php echo date("Y-m-d H:i:s",$item['create_time']);}</td>
                            <td>
                                <a href="{php echo web_url('recruit/recruitment/labelEdit',['id'=>$item['id']])}" class="btn btn-warning btn-sm">编辑</a>
                                <a href="{php echo web_url('recruit/recruitment/labelDel',['ids'=>$item['id']])}" class="btn btn-danger btn-sm" data-toggle="ajaxRemove" data-confirm="确定删除当前标签信息？">删除</a>
                            </td>
                        </tr>
                    {/loop}
                </tbody>
            </table>
        </div>
        <!--操作按钮 分页信息-->
        <div class="app-table-foot clearfix">
            <div class="pull-left">
                <button class="btn btn-default" type="button" data-toggle='batch-remove' data-confirm="确定删除当前选中的所有标签信息？" data-href="{php echo web_url('recruit/recruitment/labelDel')}">批量删除</button>
            </div>
            <div class="pull-right">{$pager}</div>
        </div>
    </div>
</div>
<script>
    /**
     * 默认职位信息生成
     */
    $("#createButton").on('click',function () {
        tip.confirm('是否确认生成默认的标签信息？',function () {
            //显示加载动画
            $("#page-loading").show();
            //请求生成
            let link = "{php echo web_url('recruit/recruitment/labelDefaultInfo');}";
            $.post(link,function (res) {
                tip.alert(res.message,function () {
                    history.go(0);
                });
            },'json');
        });
    });
</script>
{php include wl_template('common/footer');}